!18 10 35
!#vti pla code/lg to asim sidpla convertor <rom>
!# 18 inputs, 10 outputs, 35 terms
!#
!#VTI STATE MACHINE
!###############################################################
!###############################################################
!###                                                         ###
!###  IOMD ROMSM : ROMCTL STATE MACHINE                      ###
!###                                                         ###
!###  Created 22/8/92: David Flynn                           ###
!###                                                         ###
!###                                                         ###
!###############################################################
!###############################################################
!###  Revision History:                                      ###
!###   26/8/92: DWF : Revised for ROMGO naming               ###
!###   27/8/92: DWF : romactive inverted for NROMCS timing   ###
!###############################################################
!sm romsm;
!clock ck 32;
!
!reset init --> IDLE;
!
!inputs  romgo busrq dmarq la[3:2] romc[4:0] ; # t0match t1match;
!
!outputs romcs=1 rclkrom=0;
!
!define speed s6=??000 s5=??001 s4=??010 s3=??011 s2=??100 s1=??101
!             noburst=00??? burst3=01??? burst2=10??? burst1=11??? ;
!
!define quadword word3 = 11;
!
!
!# state bits allocated: active|rclk|t1pat[1:0]|t0pat[2:0]
!state IDLE=0000000
!    romgo & busrq & !dmarq --> R0,
!    --> IDLE romcs=0;
!
!state R0=1000101
!    (romc = s1) --> RB rclkrom=1,
!    --> R1;
!
!state R1=1000100
!    (romc = s2) --> RB rclkrom=1,
!    --> R2;
!
!state R2=1000011
!    (romc = s3) --> RB rclkrom=1,
!    --> R3;
!
!state R3=1000010
!    (romc = s4) --> RB rclkrom=1,
!    --> R4;
!
!state R4=1000001
!    (romc = s5) --> RB rclkrom=1,
!    --> R5;
!
!state R5=1000000
!    --> RB rclkrom=1;
!
!state RB=1100000
!    (romc != noburst) & busrq & (la != word3) --> B0,
!    (romc = noburst) & busrq & !dmarq --> R0,
!    --> IDLE romcs=0;
!
!state B0=1011000
!    (romc = burst1) --> BB rclkrom=1,
!    --> B1;
!
!state B1=1010000
!    (romc = burst2) --> BB rclkrom=1,
!    --> B2;
!
!state B2=1001000
!    --> BB rclkrom=1;
!
!state BB=1100001
!    busrq & (la != word3) --> B0,
!    --> IDLE romcs=0;
!
!end
!!##cell2 * rom lg * 79 any 0 v8r3_8
!## "16-Nov-92 GMT" "8:39:24 GMT" "16-Nov-92 GMT" "8:39:24 GMT" dflynn * _
!#Assign these values to the symbols:
!#??000 : s6
!#??001 : s5
!#??010 : s4
!#??011 : s3
!#??100 : s2
!#??101 : s1
!#00??? : noburst
!#01??? : burst3
!#10??? : burst2
!#11??? : burst1
!#Assign these values to the symbols:
!#11 : word3
!#Assign these values to the symbols:
!#0000000 : idle
!#1000101 : r0
!#1100000 : rb
!#1000100 : r1
!#1000011 : r2
!#1000010 : r3
!#1000001 : r4
!#1000000 : r5
!#1011000 : b0
!#1100001 : bb
!#1010000 : b1
!#1001000 : b2
!#Outputs not computed by the PLA:
!#Inputs not used by the PLA:
!#ck
!#Inputs to the pla, from the left:
!-------------------|------------
!                   | sssssss    
!                   | mmmmmmm  r 
!sssssss            | _______  c 
!mmmmmmm rbd        | sssssss rl 
!_______ oum  r     | rrrrrrr ok 
!sssssss msa  o     | 7654321 mr 
!rrrrrrr grrl m     | _______ co 
!7654321 oqqa c     | ddddddd sm 
!-------------------|------------
!           3243210 |            
!-------------------|-+++++++-++-
!xx01xxx xxxxxxxxxx | 0000001 00 
!xxx1xxx xxxxx11xxx | 0100001 01 
!xxxx1x0 xxxxxxx0xx | 0000011 00 
!xxxx1x0 xxxxxxxx1x | 0000011 00 
!xxxx1x0 xxxxxxxxx1 | 0000011 00 
!xx10xxx xxxxx10xxx | 0100001 01 
!xx11xxx xxxxx0xxxx | 0010000 00 
!xx11xxx xxxxxx0xxx | 0010000 00 
!10xxxxx xxxxxxxxxx | 1000000 10 
!xxxxxxx xxxxxxxxxx | 0000000 00 
!0xxxxxx 110xxxxxxx | 1000101 10 
!x1xxxxx x1x0x1xxxx | 1011000 10 
!x1xxxxx x1xx01xxxx | 1011000 10 
!x1xxxxx x1x0xx1xxx | 1011000 10 
!x1xxxxx x1xx0x1xxx | 1011000 10 
!x1xxxx1 x1x0xxxxxx | 1011000 10 
!x1xxxx1 x1xx0xxxxx | 1011000 10 
!xxxxx10 xxxxxxx1xx | 0000001 00 
!xxxxx10 xxxxxxxx0x | 0000001 00 
!xxxxx10 xxxxxxxxx1 | 0000001 00 
!xxxxx11 xxxxxxx1xx | 0000010 00 
!xxxxx11 xxxxxxxx0x | 0000010 00 
!xxxxx11 xxxxxxxxx0 | 0000010 00 
!xxxx1x1 xxxxxxx0xx | 0000100 00 
!xxxx1x1 xxxxxxxx1x | 0000100 00 
!xxxx1x1 xxxxxxxxx0 | 0000100 00 
!xx10xxx xxxxx0xxxx | 0001000 00 
!xx10xxx xxxxxx1xxx | 0001000 00 
!xxxxx10 xxxxxxx010 | 0100000 01 
!xxxxx11 xxxxxxx011 | 0100000 01 
!xxxx1x0 xxxxxxx100 | 0100000 01 
!xxxx1x1 xxxxxxx101 | 0100000 01 
!x1xxxx0 x10xx00xxx | 1000101 10 
!100x000 xxxxxxxxxx | 0100000 01 
!x0xx001 xxxxxxx001 | 0100000 01 
!-------------------|------------
!#SIDLE PROTOTYPE

 FROM STDParts.PLAs  IMPORT $PLA
 FROM STDParts.Misc  IMPORT $Sink,$BDTFF
FROM  StdParts.Gates IMPORT $SGate2


 BLOCK romsm(
     ck,
     Ninit,
     romgo,
     busrq,
     dmarq,
     la[3:2],
     romc[4:0]
   )
   =>  (
     Nromcs,
     rclkromUS
   )
 
   pla = $PLA(Vdd,Vdd,
     in(
     sm_sr1,
     sm_sr2,
     sm_sr3,
     sm_sr4,
     sm_sr5,
     sm_sr6,
     sm_sr7,
     romgo,
     VDD,
     dmarq,
     la[3:2],
     romc[4:0]
    )
   )
   =>  out(
     Ssm_sr1_d,
     Ssm_sr2_d,
     Ssm_sr3_d,
     Ssm_sr4_d,
     Ssm_sr5_d,
     Ssm_sr6_d,
     Ssm_sr7_d,
     Sromcs,
     rclkromUS
   )
   WITH (delay=ns_10,filename=iomd/sid/romsm)
 
brqs1 = $SGate2(busrq,Ssm_sr1_d) => Bsm_sr1_d WITH (delay=1,OP=AND)
brqs2 = $SGate2(busrq,Ssm_sr2_d) => Bsm_sr2_d WITH (delay=1,OP=AND)
brqs3 = $SGate2(busrq,Ssm_sr3_d) => Bsm_sr3_d WITH (delay=1,OP=AND)
brqs4 = $SGate2(busrq,Ssm_sr4_d) => Bsm_sr4_d WITH (delay=1,OP=AND)
brqs5 = $SGate2(busrq,Ssm_sr5_d) => Bsm_sr5_d WITH (delay=1,OP=AND)
brqs6 = $SGate2(busrq,Ssm_sr6_d) => Bsm_sr6_d WITH (delay=1,OP=AND)
brqs7 = $SGate2(busrq,Ssm_sr7_d) => Bsm_sr7_d WITH (delay=1,OP=AND)
brqrc = $SGate2(busrq,Sromcs   ) => Bromcs    WITH (delay=1,OP=AND)

   reg = $BDTFF(
    ck,
     d(
       Bsm_sr1_d,
       Bsm_sr2_d,
       Bsm_sr3_d,
       Bsm_sr4_d,
       Bsm_sr5_d,
       Bsm_sr6_d,
       Bsm_sr7_d,
       Bromcs
     ),
     Vdd,Ninit)
   =>  (q(
     sm_sr1,
     sm_sr2,
     sm_sr3,
     sm_sr4,
     sm_sr5,
     sm_sr6,
     sm_sr7,
     romcs
   ),qbar(zz[6:0],Nromcs))
   WITH (delay=ns_5, edge=+ve)
 
   snk1 = $Sink(zz[6:0])
   snk2 = $Sink(zzz(romcs,romcs))
 
 END {romsm}
 

